<include file="Public:header"/>
<notempty name="v['image_url']">
    <div class="row">
        <img src="{$v.image_url}" class="img-polaroid"/>
    </div>
</notempty>
<div class="row">
    <table class="table table-striped">
        <tr>
            <td>发起人</td>
            <td>{$v.email}</td>
            <td>标题</td>
            <td>{$v.title}</td>
        </tr>
        <tr>
            <td>类型</td>
            <td>{$v.type}</td>
            <td>等级</td>
            <td>{$v.level}</td>
        </tr>
        <tr>
            <td>选择类型</td>
            <td>{$v.choose}</td>
            <td>最少选择</td>
            <td>{$v.vote_min}</td>
        </tr>
        <tr>
            <td>最多选择</td>
            <td>{$v.vote_max}</td>
            <td>投票数</td>
            <td>{$v.votes}</td>
        </tr>
        <tr>
            <td>开始时间</td>
            <td>{$v.start_time|date='Y.m.d',###}</td>
            <td>结束时间</td>
            <td>{$v.end_time|date='Y.m.d',###}</td>
        </tr>
        <tr>
            <td>链接到</td>
            <td>{$v.link_to}</td>
            <td>链接地址</td>
            <td>
                <a href="{$v.link_url}">{$v.link_url}</a>
            </td>
        </tr>
        <tr>
            <td>点击数</td>
            <td>{$v.hits}</td>
            <td>内容</td>
            <td>{$v.content}</td>
        </tr>
    </table>
</div>
<div class="row">
    <form method="post" action="">
        <table class="table">
            <foreach name="subjects" item="s">
                <tr>
                    <td>
                        <if condition="$can_record">
                            <input type="radio" value="{$s.key}" name="s">
                        </if>
                        {$s.title}
                    </td>
                    <td>
                        <div class="progress progress-striped active">
                            <div class="bar" style="width: <php>echo ($s['count'] / $all_votes * 100);</php>%;"></div>
                        </div>
                        <php>echo ($s['count'] / $all_votes * 100);</php>
                        %
                    </td>
                </tr>
            </foreach>
            <if condition="$can_record">
                <tr>
                    <td colspan="2">
                        可以进行投票
                        备注<textarea name="note" rows="5"></textarea>
                        <input type="submit" value="投票" class="btn btn-primary">
                    </td>
                </tr>
            </if>
        </table>
    </form>
</div>

<notempty name="vrs">
    <div class="row">
        <table class="table table-striped">
            <tr>
                <td>Email</td>
                <td>选项</td>
                <td>投票时间</td>
                <td>备注</td>
            </tr>
            <foreach name="vrs" item="vr">
                <tr>
                    <td>***</td>
                    <td>{$vr.votes}</td>
                    <td>{$vr.vote_time|date='Y.m.d',###}</td>
                    <td>{$vr.note}</td>
                </tr>
            </foreach>
            <tr>
                <td colspan="6">{$page}</td>
            </tr>
        </table>
    </div>
</notempty>
<include file="Public:footer"/>